﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Configuration;

namespace Model
{
    public class RabbitMQConfig: ConfigurationSection
    {
        public RabbitMQConfig()
        {
        }


        [ConfigurationProperty("HostName")]
        public string HostName
        {
            get { return (string)this["HostName"]; }
            set { this["HostName"] = value; }
        }

        [ConfigurationProperty("UserName")]
        public string UserName
        {
            get { return (string)this["UserName"]; }
            set { this["UserName"] = value; }
        }

        [ConfigurationProperty("Password")]
        public string Password
        {
            get { return (string)this["Password"]; }
            set { this["Password"] = value; }
        }

        [ConfigurationProperty("exchange")]
        public string exchange
        {
            get { return (string)this["exchange"]; }
            set { this["exchange"] = value; }
        }

        [ConfigurationProperty("exchangeType")]
        public string exchangeType
        {
            get { return (string)this["exchangeType"]; }
            set { this["exchangeType"] = value; }
        }

        [ConfigurationProperty("routingKey")]
        public string routingKey
        {
            get { return (string)this["routingKey"]; }
            set { this["routingKey"] = value; }
        }

        [ConfigurationProperty("queuename")]
        public string queuename
        {
            get { return (string)this["queuename"]; }
            set { this["queuename"] = value; }
        }

        private static RabbitMQConfig _value;
        public static RabbitMQConfig Value
        {
            get
            {
                if (_value == null)
                    _value = (RabbitMQConfig)System.Configuration.ConfigurationManager.GetSection("RabbitMQConfig");
                return _value;
            }
        }
    }
}
